From 5c8eb3b72788f4aa3b26462d224376a0e468f9c6 Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Wed, 26 Oct 2005 13:41:00 +0100 Subject: [PATCH] Check whether dom is NULL when we handle a watch. This might occur if the domain has recently been removed from our list, but with a watch still in flight. This should fix the intermittent crash in xenconsoled that is plaguing us at the moment. Signed-off-by: Ewan Mellor --- tools/console/daemon/io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 0b55607d50..ef3f094d27 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -512,7 +512,9 @@ static void handle_xs(int fd) enum_domains(); else if (sscanf(vec[XS_WATCH_TOKEN], "dom%u", &domid) == 1) { dom = lookup_domain(domid); - if (dom->is_dead == false) + /* We may get watches firing for domains that have recently + been removed, so dom may be NULL here. */ + if (dom && dom->is_dead == false) domain_create_ring(dom); } -- 2.30.2